package com.imooc;

import com.imooc.controller.WelcomeController;
import org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * <h1></h1>
 * {@link AbstractAutowireCapableBeanFactory#createBean(String, RootBeanDefinition, Object[])}
 *  1. bean类型解析
 *  2. 处理方法覆盖
 *  3. bean实例化前的后置处理
 *  4. doCreateBean
 *
 *
 *  方法覆盖: {@link AbstractBeanDefinition#prepareMethodOverrides}
 * @author : dzj
 * @create: 2021-10-25 21:40
 */
@Configuration
@ComponentScan("com.imooc")
public class Debug0804_createBean {
	public static void main(String[] args) {
		String xmlPath = "F:\\ideaProjectSource\\spring-framework-5.1.x\\spring-demo\\src\\main\\resources\\spring\\spring-config.xml";
			ApplicationContext ctx = new FileSystemXmlApplicationContext(xmlPath);
		//ApplicationContext ctx = new AnnotationConfigApplicationContext(Debug0804_createBean.class);
		WelcomeController welcomeController = ctx.getBean(WelcomeController.class);
		welcomeController.handleRequest();

	}
}
